




class Gridboard:
    __slots__=("towers")
    
    def __init__(self, size):
        print("init Gridboard")
        self.towers = [x[:] for x in [[None]*10]*10]
 
        
    
    def get(self, pos):
        return self.towers[pos[0]][pos[1]]
    
    def add(self, tower):
        if self.towers[tower.pos[0]][tower.pos[1]] != None:
            return False
        self.towers[tower.pos[0]][tower.pos[1]] = tower
        return True
        
    def remove(self, tower):
        self.towers[tower.pos[0]][tower.pos[1]] = None
        return True
